package com.googlecode.cswish.struts.hibernate;

import javax.annotation.Resource;

import org.apache.log4j.Logger;

import com.googlecode.cswish.struts.AutoValidatorManager;
import com.googlecode.cswish.struts.conversion.AutoPageConverterManager;
import com.googlecode.cswish.struts.spring.BeanIntrospector;


/**
 * Dynamic model factory
 * 
 * @author Jerry.Feng Date: 2008-5-15
 */
public class DynamicModelManager {
	
	private static final Logger logger = Logger.getLogger(DynamicModelManager.class);
	
    @Resource
    private BeanIntrospector beanIntrospector;
    
    @Resource
    private HibernateConfiguration hibernateConfiguration;
    
    @Resource
    private AutoPageConverterManager converterManager;
    
    @Resource
    private AutoValidatorManager autoValidatorManager;

    public DynamicModelDef loadDefinition(String entityName) {
    	return new DynamicModelDef(entityName, beanIntrospector, 
    			converterManager, autoValidatorManager, hibernateConfiguration);
    }
}